package com.demo.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Api(tags = "页面跳转")
@Controller
@Slf4j
public class PageController {

    @GetMapping("/myLogin")
    public String myLogin(){
        return "/myLogin";
    }

    @RequestMapping("/main")
    public String main(){
        return "/main";
    }

    @PostMapping("fail")
    public String fail(Model model) {
        model.addAttribute("fail",true);
//        log.info(model.getAttribute("fail").toString());
        return "myLogin";
    }
}

